75

Build Your Own Remote Control

75

STEP 2—​read googledocs

Set HttpReq =​ CreateObject(“Microsoft.XMLHTTP”)

    HttpReq.Open “GET”, myURL, False, “”, “”

    HttpReq.send

    myURL =​ HttpReq.responseBody

    If HttpReq.Status =​ 200 Then

      Set oStrm =​ CreateObject(“ADODB.Stream”)

      oStrm.Open

      oStrm.Type =​ 1

      oStrm.Write HttpReq.responseBody

      oStrm.SaveToFile filepath, 2 ‘ 1 =​ no overwrite, 2 =​ overwrite

      oStrm.Close

    End If

    Open filepath For Input As #1

    ‘Do Until EOF(1)

      Line Input #1, LineFromFile

      StartPosition =​ InStr(LineFromFile, “SlideMover”) +​ 9

      EndPosition =​ InStr(StartPosition, LineFromFile, ““““)

      c =​ EndPosition -​ StartPosition

      If c > PreviousLen Then

        CommandWord =​ Mid(LineFromFile, StartPosition +​ PreviousLen, c

-​ PreviousLen)

        PreviousLen =​ c

      Else

        If c < PreviousLen Then

          PreviousLen =​ c

          CommandWord =​ ““

        Else

          CommandWord =​ ““

        End If

      End If

    ‘Loop

    Close #1

STEP 2—​read input and take action

      If CommandWord =​ ““ Then

        Else

          If LaunchLink =​ 2 Then

            Call ReturnToPresentation

            Exit Sub

            LaunchLink =​ 0

          End If

          If FirstT =​ 0 Then

            If InStr(CommandWord, “B”) > 0 Then

            If WhiteScreen =​ 0 Then

              Set pptLayout =​ ActivePresentation.Slides(1).CustomLayout

              Set pptSlide =​ ActivePresentation.Slides.

AddSlide(ActivePresentation.SlideShowWindow.View.CurrentShowPosition,

pptLayout)

              PreviousSlide

            WhiteScreen =​ 1

         

          Else